package com.fit.entities.training;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

import com.fit.entities.coach.Coach;
import com.fit.entities.sport.Sport;




@Embeddable
public class TrainingPK implements Serializable{
	
	@ManyToOne
	private Coach coach;
	@ManyToOne
	private Sport sport;
	
	public Coach getCoach() {
		return coach;
	}
	public void setCoach(Coach coach) {
		this.coach = coach;
	}
	public Sport getSport() {
		return sport;
	}
	public void setSport(Sport sport) {
		this.sport = sport;
	}
	
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		TrainingPK that = (TrainingPK) o;

		if (coach != null ? !coach.equals(that.coach) : that.coach != null)
			return false;
		if (sport != null ? !sport.equals(that.sport)
				: that.sport != null)
			return false;

		return true;
	}

}
